<template>
	<view class="content">
		<view class="price-box">
			<view class="title">提現金額</view>
			<view class="num-box">
				<view>￥</view>
				<input type="text" v-model="money" placeholder="請輸入金額">
				<view class="btn">全部提現</view>
			</view>
			<view class="tips">可提現金額{{myInfor.money}}</view>
		</view>
		<view class="account">
			<view class="title">提現賬戶</view>
			<view class="name">收款賬戶</view>
			<view class="account-content">
				<input type="text" v-model="account">
			</view>
		</view>
		<view class="add-btn" @click="withdraw">確認提交</view>
	</view>
</template>

<script>
	import { toWithdraw } from '../../request/api.js'
	export default {
		data() {
			return {
				account:"",
				money:""
			};
		},
		computed:{
			myInfor(){
				return this.$store.getters.myInfor
			}
		},
		methods:{
			async withdraw(){
				uni.showLoading({
					title:"提交中..."
				})
				let res=await toWithdraw({
					account:this.account,
					money:this.money
				})
				uni.hideLoading()
				uni.showToast({
					title: res.msg,
					icon: 'none'
				})
				this.account='';
				this.money='';
			}
		}
	}
</script>

<style lang="scss">
	page{
		background-color:#FAFAFA;
		.content{
			width:702rpx;margin-left:auto;
			margin-right:auto;padding-top:24rpx;
			.price-box{
				width:100%;background-color:#ffffff;
				box-shadow: 0 2rpx 12rpx 0 rgba(204,204,204,0.3);
				border-radius: 15rpx;box-sizing: border-box;
				padding:24rpx;
				.title{
					font-size:30rpx;line-height:42rpx;
					color:#040404;border-bottom:1px solid #F0F0F0;
					padding-bottom:24rpx;
				}
				.num-box{
					margin-top:60rpx;display: flex;align-items: flex-end;
					border-bottom:1px solid #F0F0F0;
					padding-bottom:21rpx;font-size:30rpx;
					color:#040404;line-height:42rpx;
					input{
						font-size:60rpx;line-height: 74rpx;flex:1;
						margin-left:10rpx;
					}
					.btn{
						font-size:26rpx;color:#D71B0A;line-height:37rpx;
					}
				}
				.tips{
					font-size:26rpx;color:#9E9E9E;line-height:37rpx;
					margin-top:10rpx;
				}
			}
			.account{
				width:100%;background-color:#ffffff;
				box-shadow: 0 2rpx 12rpx 0 rgba(204,204,204,0.3);
				border-radius: 15rpx;box-sizing: border-box;
				padding:24rpx;margin-top:24rpx;
				.title{
					font-size:30rpx;line-height:42rpx;
					color:#040404;
				}
				.name{
					font-size:26rpx;line-height:37rpx;
					color:#9E9E9E;margin-top:24rpx;
				}
				.account-content{
					width:100%;height:100rpx;
					box-sizing: border-box;
					padding:0 24rpx;
					background-color:#F6F6F6;
					border-radius: 15rpx;
					margin-top:24rpx;
					display: flex;align-items:center;
				}
			}
			.add-btn{
				width:650rpx;height:98rpx;background-color:#040404;
				display: flex;align-items: center;justify-content: center;
				border-radius: 98rpx;font-size:36rpx;color:#Ffffff;
				position: fixed;bottom:30rpx;left:50rpx;
			}
		}
	}
</style>
